package com.lg.edu.controller;

import com.lg.edu.service.NotifierService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/email")
@Slf4j
public class EmailController {

    @Autowired
    @Lazy
    private NotifierService notifierService;

    @GetMapping("/send/{email}/{code}")
    @ResponseBody
    public Boolean send(@PathVariable("email") String email, @PathVariable("code") String code) {

        return notifierService.sendMsg(email, code);

    }

}
